package com.example.aop.jdk;

public class MethodPerformance {
    private String method;
    private long begin;

    public MethodPerformance(String method) {
        this.method = method;
        begin = System.currentTimeMillis();
    }

    public void printPerformance() {
        long elapse = System.currentTimeMillis() - begin;
        System.out.println("执行" + method + "方法花费" + elapse + "毫秒.");
    }
}
